<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>OOK</title>
		<script type="text/javascript">
			window.onload = function(){
				document.getElementById("btn1").onclick = function(){
					var div = document.getElementById("d2");
					var br = document.createElement("br");
					var input = document.createElement("input");
					var button = document.createElement("input");
					input.setAttribute("type", "file");
					button.setAttribute("type", "button");
					button.setAttribute("value", "删除");
					button.onclick = function(){
						div.removeChild(br);
						div.removeChild(input);
						div.removeChild(button);
					};
					div.appendChild(br);
					div.appendChild(input);
					div.appendChild(button);
				};
			};
		</script>
	</head>
	<body>
		<br><a href="../index.jsp">back</a>
		<br><hr color="red" />
		<h5 id="title">javascript动态删除控件</h5>
		<div id="d1"><input type="file" name="file1" ><input type="button" id="btn1" name="btn" value="More"></div>
		<div id="d2"></div>
	</body>
</html>